package com.yd.mvc.baseController.util;

import com.yd.app.util.BusinessException;
import org.springframework.util.StringUtils;
import org.springframework.validation.Errors;



public class QltValidator implements org.springframework.validation.Validator{

	@Override
	public boolean supports(Class<?> clazz) {
		return true;
	}

	@Override
	public void validate(Object target, Errors errors) {
		String msg=ValidateUtils.validate(target);
		if(!StringUtils.isEmpty(msg)) {
			throw new BusinessException(0, msg);
		}
	}
}
